package org.io;

import org.rsbot.script.methods.MethodContext;
import org.rsbot.script.wrappers.RSTile;
import org.util.MethodGather;

/**
 * Created by IntelliJ IDEA.
 * User: Tim
 * Date: 9/8/11
 * Time: 5:04 PM
 * To change this template use File | Settings | File Templates.
 */
public class Walk {
    MethodContext m;

    public Walk(MethodGather methodGather) {
        m = methodGather.getMethodContext();
    }

    /**
     * @param t
     */
    public void walkTo(RSTile t) {
        while (m.calc.distanceTo(t) > 4 && m.players.getMyPlayer().isMoving()) {
            m.walking.walkTo(t);
        }
    }
}

